-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23469][ML] HashingTF should use corrected MurmurHash3 implementation #25303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #108419 has finished for PR 25303 at commit
|
mllib/src/test/scala/org/apache/spark/ml/feature/HashingTFSuite.scala
Outdated
Show resolved
Hide resolved
| assert(hashingTF.indexOf("d") === 90) | ||
| } | ||
|
|
||
| test("Load HashingTF prior to Spark 3.0") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a compatibility bug fix, could you add SPARK-23469 prefix?
|
Test build #108421 has finished for PR 25303 at commit
|
|
Test build #108422 has finished for PR 25303 at commit
|
| // We support loading old `HashingTF` saved by previous Spark versions. | ||
| // Previous `HashingTF` uses `mllib.feature.HashingTF.murmur3Hash`, but new `HashingTF` uses | ||
| // `ml.Feature.FeatureHasher.murmur3Hash`. | ||
| val (majorVersion, minorVersion) = majorMinorVersion(metadata.sparkVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good catch here.
Nit: you can replace minorVersion with _ just for tidiness
|
Test build #108478 has finished for PR 25303 at commit
|
|
Merged to master. I added a release note for this change. |
|
Thanks for your help! @srowen @dongjoon-hyun |
What changes were proposed in this pull request?
Update HashingTF to use new implementation of MurmurHash3
Make HashingTF use the old MurmurHash3 when a model from pre 3.0 is loaded
How was this patch tested?
Change existing unit tests. Also add one unit test to make sure HashingTF use the old MurmurHash3 when a model from pre 3.0 is loaded